<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<link rel="stylesheet" type="text/css" media="screen" href="/iceberg/js/jquery-ui-themes-1.10.3/themes/cupertino/jquery-ui.css" />

<link rel="stylesheet" type="text/css"
  href="/iceberg/js/jquery.jqGrid-4.5.4/css/ui.jqgrid.css">
  
<script type="text/javascript" src="/iceberg/js/jquery.jqGrid-4.5.4/js/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="/iceberg/js/jquery.jqGrid-4.5.4/js/jquery.jqGrid.min.js"></script>
<script type="text/javascript" src="/iceberg/js/jquery.jqGrid-4.5.4/js/i18n/grid.locale-en.js"></script>

<script type="text/javascript">
 jQuery(document).ready(function(){
  var lastsel2;  
  jQuery("#list2").jqGrid(
      {
        url : '/iceberg/databaseActionLoad?tableName=' + window.parent.passingObj["tableName"],
        datatype : "json",
        colNames : ${jqGridTable.colNames},
        colModel : ${jqGridTable.colModel},
        editurl: '/iceberg/databaseActionOperation?tableName=' + window.parent.passingObj["tableName"],
        rowNum : 2,
        width : 800,
        rowList : [ 2, 5, 10 ],
        jsonReader: {
           root:"rawTableData",                // 数据行（默认为：rows）
           page: "currentPageNumber",            // 当前页
           total: "totalPageSize",    // 总页数
           records: "totalRecordSize",    // 总记录数
           repeatitems : false               
        },
        prmNames:${jqGridTable.prmNames},
        pager : '#pager2',
        multiselect: true,
        viewrecords : true,
        sortorder : "desc",
        caption : "JSON Example",
        recordtext:'Total {2}: {0} - {1}'  
      });
  jQuery("#list2").jqGrid('navGrid', '#pager2', {
    edit : true,
    add : true,
    del : true
  },
  {closeOnEscape: true,closeAfterEdit: true, reloadAfterSubmit: true,
            afterSubmit: function(response)  {
                idToSelect = response.responseText;               
                return [true,'',idToSelect];
            }},
  {closeOnEscape: true,closeAfterAdd: true, reloadAfterSubmit: true,
              afterSubmit: function(response)  {
                idToSelect = response.responseText;               
                return [true,'',idToSelect];
            }},
  {closeOnEscape: true,closeAfterDel: true, reloadAfterSubmit: true ,
             afterSubmit: function(response)  {
                idToSelect = response.responseText;               
                return [true,'',idToSelect];
            }});
   });
</script>
</head>

<body>
  <form class="main">
    <table id="list2"></table>
    <div id="pager2"></div>
  </form>
</body>
</html>